This invention relates to a memory pool management method and system for use in a computer or the like.
It is well known that various devices or systems are controlled by software programs. In such a device, a program uses various data when it is executed. Though it is advantageous to high speed executing of the program that all of the data is memorized in a (main) memory, larger memory is markedly expensive. Accordingly, the memory generally has smaller size than necessary size for memorizing all of the data. Therefore, the memory memorizes a necessary part(s) of the data according to a getting request(s) from the program.
When the memory does not have assignable memory area for accepting the getting request from the program, the execution of the program is suspended until the assignable memory area appears in the memory. Accordingly, the memory must be used as efficiently as possible to avoid such situation.
A related memory pool management system is used to utilize a memory efficiently and called a variable length memory pool management system. The memory pool management system permits optional request memory size to a getting request from a program.
Upon receiving a getting request, the memory pool management system searches an available or unoccupied memory area(s) of the memory for an assignable memory area equal to or larger than request memory size. When the assignable memory area is found in the memory, the memory pool management system gets or secures a part or all of the assignable memory area as a secured memory area with the request memory size. The secured memory area is assigned to and occupied by the program. The memory pool management system repeats the above-mentioned operation whenever it receives another getting request.
On the other hand, the memory pool management system releases the occupied memory area occupied by the program in response to a release request from the program to change the occupied area into a reusable memory area. The reusable memory area is the same as the available memory area and unites with adjoining available memory area to form a continuous available memory area.
When the reusable memory area adjoins another occupied memory area, it can be used only for equal or smaller request memory size than the size thereof. Thus, there is a case where the memory pool management system can not accept a new getting request, although a total of the available memory areas is larger than the request size of the new getting request. That is, the memory pool management system has a problem of fragmentation of the available memory areas.
Another related memory pool management system is called a fixed length pool management system. The memory pool management system divides the memory area of the memory into a plurality of memory pools. Each of the memory pools includes a plurality of sub-memory pools of a size. The memory pools are different from one another in their sub-memory pool's size.
The memory pool management system permits specific request memory size to a getting request from a program. The specific request memory size must be equal to the sub-memory pool's size of any one of the memory pools. In other words, the memory pool management system secures and releases the memory area by the sub-memory pool as a unit.
Though the memory pool management system does not have the problem of fragmentation of the available memory areas, it has another problem as follow.
The memory pool management system can not accept a new getting request of the specific request memory size equal to certain sub-memory pool's size when the corresponding memory pool has no available sub-memory pool. This is true even if the other memory pools have enough available memory area(s). That is, the memory pool management system has a problem that there is a case where it can not accept the getting request in spite of enough available memory area. In other words, the memory pools management system has division disadvantage caused by division of memory area.